package com.chinafree.permission.service;

import com.chinafree.permission.model.bo.RoleBO;
import com.chinafree.permission.model.bo.RoleDepartUserEditBO;
import com.chinafree.permission.model.bo.RolePermissionEditBO;
import com.chinafree.permission.model.dto.PermissionDTO;
import com.chinafree.permission.model.dto.RoleDTO;
import com.chinafree.permission.model.dto.RoleInfoDTO;
import com.chinafree.permission.model.enumeration.PermissionTypeEnum;
import com.chinafree.permission.model.param.RoleParam;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/**
 * @description: TODO
 * @author: Sarah
 * @modified By: Sarah
 * @date: Created in 2021/7/22 17:10
 * @version:v1.0
 */

public interface RolePermissionService {

    Optional<List<RoleDTO>> getRoleList();

    Optional<Map<PermissionTypeEnum, List<PermissionDTO>>> getPermissionList();

    Optional<RoleInfoDTO> getRoleInfo(Integer roleId);

    Optional<Integer> deleteRole(Integer roleId);

    Optional<Integer> createRole(RoleBO roleBO);

    Optional<Integer> editRoleDepartUSer(RoleDepartUserEditBO roleDepartUserEditBO);

    Optional<Integer> editRolePermission(RolePermissionEditBO rolePermissionEditBO);

    Optional<Integer> editRole(RoleParam roleParam);

     void setUserPermissionToRedis(String userId);

    Optional<Set<Integer>> getUserPermissionList(String userId);

}
